package com.cl.photozoom.ui;

import android.content.Context;
import android.graphics.Bitmap;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import java.util.concurrent.ExecutionException;

/**
 * @Class: ImageEngine
 * @Description: 图片加载引擎
 * @Author: ChenLei
 * @Date: 2020/12/23---13:42
 */
public interface ImageEngine {

    /**
     * Loading image
     *
     * @param context   Context
     * @param url       图片url
     * @param imageView ImageView
     */
    void loadImage(@NonNull Context context, @NonNull String url, @NonNull ImageView imageView);

    /**
     * 保存图片到本地
     *
     * @param context Context
     * @param url     图片url
     * @return Bitmap
     */
    Bitmap downloadBitmap(@NonNull Context context, @NonNull String url) throws ExecutionException, InterruptedException;

}
